home *** CD-ROM | disk | FTP | other *** search
/ Palm Utilities / Palm_Utilities_CD-ROM_2001_2001.iso / files / utils misc / Bachmann Print Manager 2.01b / BachmannPrintManager.exe / PageMgr(Demo) / Incs / PageMgr.h next >
Encoding:
C/C++ Source or Header  |  1999-11-11  |  4.6 KB  |  153 lines

  1. /***********************************************************************
  2.  *
  3.  * Copyright ⌐ 1998, Bachmann Software and Services.
  4.  * All rights reserved.
  5.  *
  6.  * FileName:
  7.  *        PageMgr.h
  8.  *
  9.  * Description:
  10.  *        Page Manager library API definitions.  The Page Manager library
  11.  *        provides graphical printing for the Palm Computing Platform.
  12.  *
  13.  * History:
  14.  *       03/30/99    Greg Winton    Created file.
  15.  *
  16.  *    04/07/99    Greg Winton    Added functions:
  17.  *                               - PagPrintText
  18.  *                               - PagPrintLine
  19.  *                               - PagNewLine
  20.  *                               - PagNewPage
  21.  *                               - PagSetFont
  22.  *                               - PagWrite
  23.  *
  24.  *******************************************************************/
  25.  
  26. #ifndef __PAGE_MGR_H__
  27. #define __PAGE_MGR_H__
  28.  
  29. // If we're actually compiling the library code, then we need to
  30. // eliminate the trap glue that would otherwise be generated from
  31. // this header file in order to prevent compiler errors in CW Pro 2.
  32. #ifdef BUILDING_PAGE_MGR
  33.     #define PAGE_MGR_TRAP(trapNum)
  34. #else
  35.     #define PAGE_MGR_TRAP(trapNum) SYS_TRAP(trapNum)
  36. #endif
  37.  
  38.  
  39. // PalmPilot common definitions
  40. #include <Common.h>
  41. #include <SystemMgr.rh>
  42.  
  43. // PageMgr Definitions
  44. #include <PageMgrDefines.h>
  45. #include <SystemMgr.h>
  46.  
  47. //-----------------------------------------------------------------------------
  48. // Page Manager library function trap ID's. Each library call gets a trap number:
  49. //   pagTrapXXXX which serves as an index into the library's dispatch table.
  50. //   The constant sysLibTrapCustom is the first available trap number after
  51. //   the system predefined library traps Open,Close,Sleep & Wake.
  52. //
  53. // WARNING!!! The order of these traps MUST match the order of the dispatch
  54. //  table in SampleLibDispatch.c!!!
  55. //-----------------------------------------------------------------------------
  56.  
  57. typedef enum {
  58.    pagTrapGetLibAPIVersion = sysLibTrapCustom,
  59.    pagTrapSetOption,
  60.    pagTrapPrintText,
  61.    pagTrapPrintLine,
  62.    pagTrapNewLine,
  63.    pagTrapNewPage,
  64.    pagTrapSetFont,
  65.    pagTrapWrite,
  66.    pagTrapOpenByConfig,
  67.    pagTrapGetConfigValue,
  68.  
  69.     pagTrapLast
  70.     } PageMgrTrapNumberEnum;
  71.  
  72. /********************************************************************
  73.  * API Prototypes
  74.  ********************************************************************/
  75.  
  76. #ifdef __cplusplus
  77. extern "C" {
  78. #endif
  79.  
  80. //--------------------------------------------------
  81. // Standard library open, close, sleep and wake functions
  82. //--------------------------------------------------
  83.  
  84. extern Err PagOpen(UInt refNum, CharPtr printerName, CharPtr portName)
  85.                 PAGE_MGR_TRAP(sysLibTrapOpen);
  86.                 
  87. extern Err PagClose(UInt refNum)
  88.                 PAGE_MGR_TRAP(sysLibTrapClose);
  89.  
  90. extern Err PagSleep(UInt refNum)
  91.                 PAGE_MGR_TRAP(sysLibTrapSleep);
  92.  
  93. extern Err PagWake(UInt refNum)
  94.                 PAGE_MGR_TRAP(sysLibTrapWake);
  95.  
  96.  
  97. //--------------------------------------------------
  98. // Custom library API functions
  99. //--------------------------------------------------
  100.     
  101. // Get our library API version
  102. extern Err PagGetLibAPIVersion(UInt refNum, DWordPtr dwVerP)
  103.                 PAGE_MGR_TRAP(pagTrapGetLibAPIVersion);
  104.  
  105. // Set an option.
  106. extern Err PagSetOption(UInt refNum, PagOptionEnum option, DWord value)
  107.             PAGE_MGR_TRAP(pagTrapSetOption);
  108.  
  109. // Print text.
  110. extern Err PagPrintText(UInt refNum, CharPtr text)
  111.                 PAGE_MGR_TRAP(pagTrapPrintText);
  112.                 
  113. // Print a line of text.
  114. extern Err PagPrintLine(UInt refNum, CharPtr line)
  115.                 PAGE_MGR_TRAP(pagTrapPrintLine);
  116.                 
  117. // Go to next line.
  118. extern Err PagNewLine(UInt refNum)
  119.                 PAGE_MGR_TRAP(pagTrapNewLine);
  120.                 
  121. // Eject the current page.
  122. extern Err PagNewPage(UInt refNum)
  123.                 PAGE_MGR_TRAP(pagTrapNewPage);
  124.                 
  125. // Set the font.
  126. extern Err PagSetFont(UInt refNum, PagFontPtr fontP)
  127.                 PAGE_MGR_TRAP(pagTrapSetFont);
  128.                 
  129. // Write bytes to the printer.
  130. extern Err PagWrite(UInt refNum, BytePtr bytes, UInt len)
  131.                 PAGE_MGR_TRAP(pagTrapWrite);
  132.  
  133. // Open via BPMConfig settings
  134. extern Err PagOpenByConfig (UInt refNum)                
  135.             PAGE_MGR_TRAP(pagTrapOpenByConfig);
  136.  
  137. // get config value 
  138. extern Err  PagGetConfigValue(UInt refNum,CharPtr szKey,CharPtr szBuf,Int size)
  139.             PAGE_MGR_TRAP(pagTrapGetConfigValue);
  140.  
  141. // For loading the library in PalmPilot Mac emulation mode
  142. extern Err PagInstall(UInt refNum, SysLibTblEntryPtr entryP);
  143.  
  144. #ifdef __cplusplus 
  145. }
  146. #endif
  147.  
  148. /********************************************************************
  149.  * Public Macros
  150.  ********************************************************************/
  151.  
  152. #endif    // __PAGE_MGR_H__
  153.